<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/2/25
  Time: 12:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>商品类型</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>
</head>
<body>
    <button class="layui-btn">添加</button>
    <table id="myTable"></table>
    <script type="text/html" id="bar1">
        <a class="layui-btn layui-btn-xs" lay-event="parm1">属性列表</a>
        <a class="layui-btn layui-btn-xs" lay-event="parm2">参数列表</a>
    </script>
    <script type="text/html" id="bar2">
        <a class="layui-btn layui-btn-xs" lay-event="upd">编辑</a>
        <a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
    </script>
    <!--layui代码-->
    <script>
        layui.use(['table'],function () {
            var table = layui.table;
            var $ = layui.$;
            table.render({
                elem:'#myTable',
                url:'attribute/select',
                page:true,
                limit:3,
                limits:[3,4,5],
                cols:[[
                    {field:'id',title:'编号',width:80, sort: true},
                    {field:'name',title:'类型名称',width:80, sort: true},
                    {field:'attribute_count',title:'属性数量',width:80, sort: true},
                    {field:'param_count',title:'参数数量',width:80, sort: true},
                    {title:'设置',toolbar:'#bar1'},
                    {title:'操作',toolbar:'#bar2'},
                ]]
            })
        })
    </script>
</body>
</html>
